package StringTest;

public class Test8 {
    public static void main(String[] args) {
       String s="Hello World";
       int count=0;
        for (int i = s.length()-1; i>=0; i--) {

            if(s.charAt(i)==' '){
                break;
            }
            count++;
        }
        System.out.println(count);

    }
}
